const http = require("node:http")
const hostname = "127.0.0.1";
const port = 3000;

const server = http.createServer((req,resp)=>{
    resp.statusCode = 200;
    resp.setHeader("Content-Type","text/plain;charset=UTF-8");
  
    resp.end("你好，我是第一个node/js服务器")
})

server.listen(port,hostname,()=>{
    console.log(`服务已启动，请访问：http://${hostname}:${port}`)
})